<extend name="Public:base" />
<block name="header_styles">
    <link href="__Public__/js/croppic/croppic.css" rel="stylesheet" />
    <style type="text/css">
        body {
            background-color: #efefde;
        }

        #croppic {
            width: 200px;
            height: 200px;
            margin: 0px;
        }

        .cropControls:not(:empty) {
            z-index: 2;
            position: absolute;
            height: 30px;
            display: block;
            left: 0px;
            right: 0px;
            font-family: sans-serif;
            background-color: rgba(0,0,0,0.35);
            bottom: 0px;
        }
    </style>
</block>
<block name="main">
    <div class="section">
                    <div class="section-title">
                        &nbsp;企业LOGO
                    </div>
                    <div class="section-content">
                        <br />
                        <div class="user-avatar">
                            <div>
                                <empty name="userinfo.photo">
                                    <div id="croppic"></div>
                                    <else />
                                    <notempty name="userinfo.photo">
                                        <div id="croppic" style="background-image: url(__APP__/{$userinfo.photo});"></div>
                                        <else />
                                        <div id="croppic" style="background-image: url(__APP__/Public/themes/images/dummy-avatar-man.jpg);"></div>
                                    </notempty>
                                </empty>
                            </div>

                            <div class="text-center">
                                <input type="hidden" name="filename" id="userpic" />
                                <button class="btn-green2" id="cropContainerHeaderButton">上传文件</button>
                                <button class="btn-green2" id="btnSavePhoto" onclick="savePhoto();">保存</button>
                                <button class='btn-green2' id='jsonptest' onclick="reqjsonp();">JSONP测试</button>
                            </div>
                        </div>
                    </div>
                </div>
</block>
<block name="footer_scripts">
    <script src="__Public__/js/croppic/croppic.js"></script>
    <script src="__Public__/js/location_cn.js"></script>
    <script type="text/javascript">
        function reqjsonp(){
            $.ajax({
                type: "get",
                async: false,
                url: "{:U('/Common/jsonpf@'.getDomain(), '', '')}",
                dataType: "jsonp",
                jsonp: "callback",//传递给请求处理程序或页面的，用以获得jsonp回调函数名的参数名(一般默认为:callback)
                jsonpCallback:"callme",//自定义的jsonp回调函数名称，默认为jQuery自动生成的随机函数名，也可以写"?"，jQuery会自动为你处理数据
                success: function(data){
                    //alert("哈哈");
                    $.boroshare.alert({content: data.msg});
                },
                error: function(){}
            });
        }
    </script>
</block>